@use 'element-plus/theme-chalk/src/mixins/function.scss' as *;

* {
  outline: none;
}

:root {
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-width: 1200px;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.app-layout {
  background: getCssVar('bg-color', 'page');

  .app-header {
    height: 58px;
    padding: 0 16px 0 24px;
    display: flex;
    align-items: center;
    background: getCssVar('color-primary');
    box-shadow: getCssVar('box-shadow', 'lighter');
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 99;

    .app-logo {
      flex-shrink: 0;
      height: 100%;
      display: flex;
      align-items: center;
      gap: 8px;
      color: #fff;
      font-size: 18px;
      font-weight: 600;
      font-family:
        -apple-system,
        BlinkMacSystemFont,
        Segoe UI;
      margin: 0 auto 0 0;

      img {
        width: 30px;
        height: 30px;
        filter: contrast(0%) brightness(1000%);
      }

      span {
        transform: translateY(-2px);
      }
    }

    .app-dark-switch {
      position: relative;

      .el-switch {
        height: 22px;
        line-height: 22px;
        position: static;

        .el-switch__core {
          #{getCssVarName('switch','off-color')}: getCssVar(
            'border-color',
            'extra-light'
          );
          #{getCssVarName('switch','on-color')}: getCssVar(
            'border-color',
            'extra-light'
          );
          height: 22px;
          border-radius: 11px;
          border: none;
          background: rgba(255, 255, 255, 0.38);

          .el-switch__action {
            color: getCssVar('text-color', 'regular');
            background: getCssVar('bg-color');
            width: 18px;
            height: 18px;
            font-size: 12px;
            left: 2.65px;
          }
        }

        &.is-checked .el-switch__core .el-switch__action {
          left: calc(100% - 20px);
        }

        &::before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
        }
      }
    }

    .app-user-avatar {
      flex-shrink: 0;
      margin-right: 20px;
      display: flex;
      align-items: center;
      gap: 6px;
      color: #fff;
      font-size: 14px;
      cursor: pointer;

      img {
        width: 32px;
        height: 32px;
        border-radius: 50%;
      }
    }
  }

  .app-body {
    display: flex;
    box-sizing: border-box;
  }

  .app-sidebar-wrapper {
    height: calc(100vh - 58px);
    padding: 16px 0 16px 16px;
    box-sizing: border-box;
    position: sticky;
    top: 58px;
  }

  .app-sidebar {
    flex-shrink: 0;
    width: 240px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    background: getCssVar('bg-color');
    box-shadow: getCssVar('box-shadow', 'lighter');
    box-sizing: border-box;

    .app-sidebar-menus {
      flex: 1;
      padding: 6px;
      box-sizing: border-box;
      scrollbar-width: thin;
      overflow: auto;
    }

    .app-menu-item {
      flex-shrink: 0;
      height: 40px;
      display: flex;
      align-items: center;
      padding: 0 16px;
      color: getCssVar('text-color', 'primary');
      font-size: getCssVar('font-size', 'base');
      border-radius: 6px;
      transition: all 0.3s;
      box-sizing: border-box;
      text-decoration: none;

      & > .el-icon {
        font-size: 16px;
        margin-right: 8px;
        transform: translateY(1px);
      }

      &:hover {
        background: getCssVar('fill-color', 'light');
      }

      &.is-active {
        color: getCssVar('color-primary');
        background: getCssVar('color-primary', 'light-9');
      }

      & + .app-menu-item {
        margin-top: 6px;
      }
    }

    .app-sidebar-label {
      flex-shrink: 0;
      border-top: 1px solid getCssVar('border-color', 'light');
      color: getCssVar('text-color', 'placeholder');
      font-size: 13px;
      padding: 8px 16px 0 16px;
      box-sizing: border-box;
    }

    .app-theme-colors {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 16px 18px 16px;
      box-sizing: border-box;

      .app-theme-color-item {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 13px;
        cursor: pointer;
      }
    }
  }

  .app-content {
    flex: 1;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;

    .app-input-group {
      display: flex;

      .el-input__wrapper {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
      }

      .el-button {
        margin-left: -1px;
        position: relative;
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
      }
    }
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root),
html.dark::view-transition-old(root) {
  z-index: 1;
}

::view-transition-old(root),
html.dark::view-transition-new(root) {
  z-index: 2147483646;
}

html.disabled-transition,
html.disabled-transition :not(.view-transition-trigger) * {
  transition: none !important;
}

.slide-bottom-enter-active,
.slide-bottom-leave-active {
  transition: (opacity 0.2s ease-out, transform 0.25s ease-out);
}

.slide-bottom-enter-from {
  opacity: 0;
  transform: translateY(-10%);
}

.slide-bottom-leave-to {
  opacity: 0;
  transform: translateY(10%);
}
